package ua.kpi.flats.entity;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import ua.kpi.flats.entity.enums.SuitableOptionsEnum;

@Entity
@Table(name = "SUITABLE_OPTIONS")
public class SuitableOption implements Serializable {	
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "OPTIONSID")
	private long id;
	
	@ManyToOne(cascade = CascadeType.ALL)
	@JoinColumn(name = "FLATID")
	private Flat flat;
	
	@ManyToOne(cascade = CascadeType.ALL,fetch = FetchType.EAGER)
	@JoinColumn(name = "APPLICATIONID")
	private BuyApplication application;
	
	@Enumerated(value = EnumType.STRING)
	@Column(name = "STATUS")
	private SuitableOptionsEnum status;
	
	public SuitableOption() {
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public Flat getFlat() {
		return flat;
	}

	public void setFlat(Flat flat) {
		this.flat = flat;
	}

	public BuyApplication getApplication() {
		return application;
	}

	public void setApplication(BuyApplication application) {
		this.application = application;
	}

	public SuitableOptionsEnum getStatus() {
		return status;
	}

	public void setStatus(SuitableOptionsEnum status) {
		this.status = status;
	}
}
